from alipay import AliPay

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

app_private_key_string = open("./keys/app_private_2048.txt").read()
alipay_public_key_string = open("./keys/alipay_public_2048.txt").read()


alipay = AliPay(
    appid="2016092600603658",
    app_notify_url=None,  # the default notify path
    app_private_key_string=app_private_key_string,
    # alipay public key, do not use your own public key!
    alipay_public_key_string=alipay_public_key_string,
    sign_type="RSA2",  # RSA or RSA2
    debug=True  # False by default
)


result = alipay.api_alipay_trade_query(trade_no="2020061722001403260500813653")
print(result)
